package com.ruoyi.znjc.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.znjc.mapper.ZnjcUsersubMapper;
import com.ruoyi.znjc.domain.ZnjcUsersub;
import com.ruoyi.znjc.service.IZnjcUsersubService;

/**
 * 用户订阅Service业务层处理
 * 
 * @author ZNJC
 * @date 2025-07-24
 */
@Service
public class ZnjcUsersubServiceImpl implements IZnjcUsersubService 
{
    @Autowired
    private ZnjcUsersubMapper znjcUsersubMapper;

    /**
     * 查询用户订阅
     * 
     * @param subId 用户订阅主键
     * @return 用户订阅
     */
    @Override
    public ZnjcUsersub selectZnjcUsersubBySubId(Long subId)
    {
        return znjcUsersubMapper.selectZnjcUsersubBySubId(subId);
    }

    /**
     * 查询用户订阅列表
     * 
     * @param znjcUsersub 用户订阅
     * @return 用户订阅
     */
    @Override
    public List<ZnjcUsersub> selectZnjcUsersubList(ZnjcUsersub znjcUsersub)
    {
        return znjcUsersubMapper.selectZnjcUsersubList(znjcUsersub);
    }

    /**
     * 新增用户订阅
     * 
     * @param znjcUsersub 用户订阅
     * @return 结果
     */
    @Override
    public int insertZnjcUsersub(ZnjcUsersub znjcUsersub)
    {
        znjcUsersub.setCreateTime(DateUtils.getNowDate());
        return znjcUsersubMapper.insertZnjcUsersub(znjcUsersub);
    }

    /**
     * 修改用户订阅
     * 
     * @param znjcUsersub 用户订阅
     * @return 结果
     */
    @Override
    public int updateZnjcUsersub(ZnjcUsersub znjcUsersub)
    {
        znjcUsersub.setUpdateTime(DateUtils.getNowDate());
        return znjcUsersubMapper.updateZnjcUsersub(znjcUsersub);
    }

    /**
     * 批量删除用户订阅
     * 
     * @param subIds 需要删除的用户订阅主键
     * @return 结果
     */
    @Override
    public int deleteZnjcUsersubBySubIds(Long[] subIds)
    {
        return znjcUsersubMapper.deleteZnjcUsersubBySubIds(subIds);
    }

    /**
     * 删除用户订阅信息
     * 
     * @param subId 用户订阅主键
     * @return 结果
     */
    @Override
    public int deleteZnjcUsersubBySubId(Long subId)
    {
        return znjcUsersubMapper.deleteZnjcUsersubBySubId(subId);
    }
}
